package com.countryfinancial.android;

import android.os.Bundle;
import com.countryfinancial.android.auto.*;
import com.countryfinancial.android.property.*;
import com.countryfinancial.android.demo.*;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class DemoActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_demo);
        Button propertyButton = (Button)findViewById(R.id.button_property_demo);
        propertyButton.setOnClickListener(propertyListener);
        Button cameraButton = (Button)findViewById(R.id.button_camera_demo);
        cameraButton.setOnClickListener(cameraListener);        
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_demo, menu);
        return true;
    }
    
    public void showAuto(View view) {
    	Intent intent = new Intent(this, AutoHomePageActivity.class);
    	startActivity(intent);
    }
    public void showProperty(View view) {
    	Intent intent = new Intent(this, PropertyHomePageActivity.class);
    	startActivity(intent);
    }    
    public void showCamera(View view) {
    	Intent intent = new Intent(this, CameraActivity.class);
    	startActivity(intent);
    }    
    
    private OnClickListener propertyListener = new OnClickListener() {
		
		@Override
		public void onClick(View v) {
			Intent intent = new Intent(DemoActivity.this, PropertyHomePageActivity.class);
	    	startActivity(intent);			
		}
	};
	
    private OnClickListener cameraListener = new OnClickListener() {
		
		@Override
		public void onClick(View v) {
			Intent intent = new Intent(DemoActivity.this, CameraActivity.class);
	    	startActivity(intent);			
		}
	};	
}
